import request from '@/utils/request'

const apiName = "blog"
export default {
  getPageList(blogQuery) {
    return request({
      url: `${apiName}/list`,
      method: 'post',
      data: blogQuery
    })
  },
  getById(id) {
    return request({
      url: `${apiName}/get/${id}`,
      method: 'get'
    })
  },

  save(blog) {
    return request({
      url: `${apiName}/save`,
      method: 'post',
      data: blog
    })
  },

  updateById(blog) {
    return request({
      url: `${apiName}/update`,
      method: 'put',
      data: blog
    })
  },
  updateStatus(id, status) {
    let blog = {
      id: id,
      status: status
    };
    this.updateById(blog)
  },
  removeById(id) {
    return request({
      url: `${apiName}/remove/${id}`,
      method: 'delete'
    })
  },
  removeRows(idList) {
    return request({
      url: `${apiName}/batchRemove`,
      method: 'delete',
      data: idList
    })
  }

}
